package com.wman.mvp;

import android.os.Bundle;
import android.widget.Button;
import android.widget.TextView;

import com.wman.R;

import androidx.appcompat.app.AppCompatActivity;

/**
 * 主流上理解的MVP是在代码结构上对C进行了拆分
 * MVC 同样可以分开
 */
public class MvpActivity extends AppCompatActivity implements Presenter.IView {

    private TextView mTv1, mTv2;
    private Button mButton;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        mTv1 = findViewById(R.id.textView);
        mTv2 = findViewById(R.id.textView2);
        mButton = findViewById(R.id.button);

        new Presenter(this).load();
    }

    @Override
    public void showData(String str1, String str2) {
        mTv1.setText(str1);
        mTv2.setText(str2);
    }
}
